/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javafx179labs.nez.hr.util;

import java.util.List;
import java.util.ArrayList;

/**
 *
 * @author civil
 */
public class FilterList<T> {
    private Filter filter = null;
    public FilterList(Filter filter) {
        this.filter = filter;
    }

    public List filterList(List<T> list) {
        List<T> resultList = new ArrayList<T>();
        for (T obj : list) {
            if(filter.filter(obj)) {
                resultList.add(obj);
            }
        }
        return resultList;
    }
}
